package thinkingJava.chapter09;

import java.util.Arrays;

class Processer {
	public String name() {
		return getClass().getSimpleName();
	}
	Object process(Object input) {
		return input;
	}
}
class UpProcesser extends Processer {
	String process(Object input) {
		return ((String)input).toUpperCase();
	}
}
class SpliterProcesser extends Processer {
	String process(Object input) {
		return Arrays.toString(((String)input).split(" "));
	}
}
class LowerProcesser extends Processer {
	String process(Object input) {
		return ((String)input).toLowerCase();
	}
}
public class Apply {
	public static void process(Processer p , Object s) {
		System.out.println(p.name());
		System.out.println(p.process(s));
	}
	public static String s = "Disagreement with beliefs is indefination by fath!";
	public static void main(String[] args) {
		process(new UpProcesser() , s);
		process(new LowerProcesser() , s);
		process(new SpliterProcesser() , s);
	}
}
